/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aviso.entity.util;

import aviso.entity.Area;
import aviso.facade.AreaFacade;
import aviso.entity.AreaType;
import aviso.facade.AreaTypeFacade;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author avgusti
 */
@ManagedBean(name="initialDataLoader")
@SessionScoped
public class InitialDataLoader {

    @EJB
    private AreaFacade areaFacade;
    @EJB
    private AreaTypeFacade areaTypeFacade;

    /** Creates a new instance of IntialDataLoader */
    public InitialDataLoader() {
    }

    public void clearAll() {
        List<AreaType> ArtList = areaTypeFacade.findAll();
        for (AreaType at : ArtList) {
            areaTypeFacade.remove(at);
        }
        List<Area> ArList = areaFacade.findAll();
        for (Area at : ArList) {
            areaFacade.remove(at);
        }
       
    }
}
